//
//  jvmrun.h
//  iCodeMacRun
//
//  Created by Andrew Barry on 30/05/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#include <JavaVM/jni.h>


@interface jvmrun : NSObject {
	JNIEnv* env;
	jclass dblayerClass, doubleClass, integerClass;
	jmethodID doubleConstructor, integerConstructor;
	jobject dbconnection, dbconnectionRef;
	jmethodID dblayerConstructor;
	jmethodID dbconnect, dbsetconn;
	jmethodID dbclose;
	jmethodID dbselect;
	jmethodID dbexecute;
}
+(jvmrun *) instance;
+(void) setJDBCDriver: (NSString *) driver;
+(void) setJDBCClass: (NSString *) className;
+(void) setJDBCConnection: (NSString *) connStr;

-(void)startupJava;
-(bool) dbConnect: (NSString *)  uid withPassword: (NSString *) pwd;
-(void) dbClose;
-(bool) dbExecute: (const char *) sql withArgs: (jsvalue *) args withArgCount: (int) argCount;
-(jsvalue) dbSelect: (const char *) sql withArgs: (jsvalue *) args withArgCount: (int) argCount;

@end
